<template>
    <div class="user-container">
        <ul class="mui-table-view fliter">
            <li class="mui-table-view-cell mui-media">
                <a href="javascript:;">
                    <img class="mui-media-object mui-pull-left" src="../../images/shuijiao.jpg">
                    <div class="mui-media-body">
                        {{$store.state.user}}
                        <p class='mui-ellipsis'>{{$store.state.email}}</p>
                    </div>
                </a>
            </li>
        </ul>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <router-link class="mui-navigate-right" :to="'/user/editpwd/'+$store.state.user_id">修改密码</router-link>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right">我的购物车</a>
            </li>
            <li class="mui-table-view-cell">
                <router-link class="mui-navigate-right" :to="'/user/address/'+$store.state.user_id">收货地址管理</router-link>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-text-center" @click.prevent="loginOut">退出登录</a>
            </li>
        </ul>
    </div>
</template>

<script>
    import login from '../subcomponents/login.vue'
    import {Toast} from 'mint-ui'
    export default {
        data(){
          return{
              obj:{},
          }
        },
        components:{
            login
        },
        /*created(){
            this.getInfo();
        },*/
        methods:{
            loginOut(){
                localStorage.setItem('user',JSON.stringify('[]'));
                localStorage.setItem('email',JSON.stringify('[]'));
                localStorage.setItem('id',JSON.stringify('[]'));
                this.$router.push('/');
            },
            // getInfo(){
            //     this.$http.get('http://127.0.0.1:3002/getInfo?id='+this.$route.param.id).then((result)=>{
            //         if(result.body.status == 0){
            //             this.obj = result.body.message[0];
            //             console.log(this.obj);
            //         }else{
            //             Toast('网络抽风了')
            //         }
            //     })
            // }
        }
    }
</script>

<style scoped>
    .fliter{
        height: 90px;
        padding: 15px 5px;
    }
</style>